<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
  
        /*.tab {
           margin: 3em;
           position: relative;
           display: inline-block;
           padding: .5em 1em .35em;
           color: white;
        }

        .tab::before {
            content: '';
            position: absolute;
            top: 0;right: 0;bottom: 0;left: 0;
            z-index: -1;
            background: #58a;
            transform:scaleY(1.3) perspective(.5em) rotateX(5deg);
            transform-origin: bottom;
        }*/

        /**
 * Trapezoid tabs
 */

body {
	padding: 40px;
	font: 130%/2 Frutiger LT Std, sans-serif;
}

nav {
	position: relative;
	z-index: 1;
	padding-left: 1em;
}

nav > a {
	position: relative;
	display: inline-block;
	padding: .3em 1em 0;
	color: inherit;
	text-decoration: none;
	margin: 0 -.3em;
} 

nav > a::before,
main {
	border: .1em solid rgba(0,0,0,.4);
}

nav a::before {
	content: ''; /* To generate the box */
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	z-index: -1;
	border-bottom: none;
	border-radius: .5em .5em 0 0;
	background: #ccc linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,0));
	box-shadow: 0 .15em white inset;
	transform: scale(1.1, 1.3) perspective(.5em) rotateX(5deg);
	transform-origin: bottom;
}

nav a.selected { z-index: 2;}

nav a.selected::before {
	background-color: #eee;
	margin-bottom: -.08em;
}

main {
	display: block;
	margin-bottom: 1em;
	background: #eee;
	padding: 1em;
	border-radius: .15em;
}

nav.left > a::before {
	transform: scale(1.2, 1.3) perspective(.5em) rotateX(5deg);
	transform-origin: bottom left;
}

nav.right { padding-left: 2em; }

nav.right > a::before {
	transform: scale(1.2, 1.3) perspective(.5em) rotateX(5deg);
	transform-origin: bottom right;
}


        
    </style>
</head>
<body>
    <!--<span class="tab">
        TRAPEZOID
    </span>-->

    <!-- This HTML is invalid and just for demo purposes. Don't use multiple main elements! -->

    <nav>
        <a href="#">Home</a>
        <a href="#" class="selected">Projects</a>
        <a href="#">About</a>
    </nav>
    <main>
        Content area
    </main>

    <nav class="left">
        <a href="#">Home</a>
        <a href="#" class="selected">Projects</a>
        <a href="#">About</a>
    </nav>
    <main>
        Content area
    </main>

    <nav class="right">
        <a href="#">Home</a>
        <a href="#" class="selected">Projects</a>
        <a href="#">About</a>
    </nav>
    <main>
        Content area
    </main>

</body>
</html>